Position the popup above the sample if there is not enough room below.
authorMatthias Clasen <maclas@gmx.de>
Tue, 2 Mar 2004 18:53:55 +0000 (18:53 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 2 Mar 2004 18:53:55 +0000 (18:53 +0000)
Tue Mar  2 19:54:53 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcombobox.c (gtk_combo_box_list_position): Position
the popup above the sample if there is not enough room below.
Part of #135543.

Tue Mar  2 19:53:36 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make the
frame for the list mode etched in, to give the popup a slightly
less flat appearance.

Tue Mar  2 17:55:31 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtk.def: Add gtk_combo_box_entry_new_text().

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index be4cdd762ee7039686096ce60ea58a60111da022..d4123fa2b21f78247f9a504851eb078134051f81 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Tue Mar  2 19:54:53 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_list_position): Position
+       the popup above the sample if there is not enough room below.
+       Part of #135543.
+
+Tue Mar  2 19:53:36 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make the 
+       frame for the list mode etched in, to give the popup a slightly
+       less flat appearance. 
+
+Tue Mar  2 17:55:31 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtk.def: Add gtk_combo_box_entry_new_text().  
+
 2004-03-02  Morten Welinder  <terra@gnome.org>
 
        * tests/testfilechooser.c (size_prepared_cb): Don't scale images
index be4cdd762ee7039686096ce60ea58a60111da022..d4123fa2b21f78247f9a504851eb078134051f81 100644 (file)
@@ -1,3 +1,19 @@
+Tue Mar  2 19:54:53 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_list_position): Position
+       the popup above the sample if there is not enough room below.
+       Part of #135543.
+
+Tue Mar  2 19:53:36 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make the 
+       frame for the list mode etched in, to give the popup a slightly
+       less flat appearance. 
+
+Tue Mar  2 17:55:31 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtk.def: Add gtk_combo_box_entry_new_text().  
+
 2004-03-02  Morten Welinder  <terra@gnome.org>
 
        * tests/testfilechooser.c (size_prepared_cb): Don't scale images
index be4cdd762ee7039686096ce60ea58a60111da022..d4123fa2b21f78247f9a504851eb078134051f81 100644 (file)
@@ -1,3 +1,19 @@
+Tue Mar  2 19:54:53 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_list_position): Position
+       the popup above the sample if there is not enough room below.
+       Part of #135543.
+
+Tue Mar  2 19:53:36 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make the 
+       frame for the list mode etched in, to give the popup a slightly
+       less flat appearance. 
+
+Tue Mar  2 17:55:31 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtk.def: Add gtk_combo_box_entry_new_text().  
+
 2004-03-02  Morten Welinder  <terra@gnome.org>
 
        * tests/testfilechooser.c (size_prepared_cb): Don't scale images
index be4cdd762ee7039686096ce60ea58a60111da022..d4123fa2b21f78247f9a504851eb078134051f81 100644 (file)
@@ -1,3 +1,19 @@
+Tue Mar  2 19:54:53 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_list_position): Position
+       the popup above the sample if there is not enough room below.
+       Part of #135543.
+
+Tue Mar  2 19:53:36 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make the 
+       frame for the list mode etched in, to give the popup a slightly
+       less flat appearance. 
+
+Tue Mar  2 17:55:31 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtk.def: Add gtk_combo_box_entry_new_text().  
+
 2004-03-02  Morten Welinder  <terra@gnome.org>
 
        * tests/testfilechooser.c (size_prepared_cb): Don't scale images
index be4cdd762ee7039686096ce60ea58a60111da022..d4123fa2b21f78247f9a504851eb078134051f81 100644 (file)
@@ -1,3 +1,19 @@
+Tue Mar  2 19:54:53 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_list_position): Position
+       the popup above the sample if there is not enough room below.
+       Part of #135543.
+
+Tue Mar  2 19:53:36 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make the 
+       frame for the list mode etched in, to give the popup a slightly
+       less flat appearance. 
+
+Tue Mar  2 17:55:31 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtk.def: Add gtk_combo_box_entry_new_text().  
+
 2004-03-02  Morten Welinder  <terra@gnome.org>
 
        * tests/testfilechooser.c (size_prepared_cb): Don't scale images
index fbc7cd3d20fdcdaaab1c8210871c5a930192b3ea..86936db84f0bc7e57f1e567185538b4be435e774 100644 (file)
@@ -761,7 +761,7 @@ gtk_combo_box_set_popup_widget (GtkComboBox *combo_box,
 
           combo_box->priv->popup_frame = gtk_frame_new (NULL);
           gtk_frame_set_shadow_type (GTK_FRAME (combo_box->priv->popup_frame),
-                                     GTK_SHADOW_NONE);
+                                     GTK_SHADOW_ETCHED_IN);
           gtk_container_add (GTK_CONTAINER (combo_box->priv->popup_window),
                              combo_box->priv->popup_frame);
 
@@ -821,11 +821,13 @@ gtk_combo_box_list_position (GtkComboBox *combo_box,
   GdkScreen *screen;
   gint monitor_num;
   GdkRectangle monitor;
+  GtkRequisition popup_req;
   
   sample = GTK_BIN (combo_box)->child;
 
   *width = sample->allocation.width;
-  *height = sample->allocation.height;
+  gtk_widget_size_request (combo_box->priv->popup_window, &popup_req);
+  *height = popup_req.height;
 
   gdk_window_get_origin (sample->window, x, y);
 
@@ -852,6 +854,11 @@ gtk_combo_box_list_position (GtkComboBox *combo_box,
     *x = monitor.x;
   else if (*x + *width > monitor.x + monitor.width)
     *x = monitor.x + monitor.width - *width;
+  
+  if (*y + sample->allocation.height + *height <= monitor.y + monitor.height)
+    *y += sample->allocation.height;
+  else
+    *y -= *height;
 } 
 
 /**
@@ -894,13 +901,14 @@ gtk_combo_box_popup (GtkComboBox *combo_box)
       return;
     }
 
+  gtk_widget_show_all (combo_box->priv->popup_frame);
   gtk_combo_box_list_position (combo_box, &x, &y, &width, &height);
 
   gtk_widget_set_size_request (combo_box->priv->popup_window, width, -1);  
-  gtk_window_move (GTK_WINDOW (combo_box->priv->popup_window), x, y + height);
+  gtk_window_move (GTK_WINDOW (combo_box->priv->popup_window), x, y);
 
   /* popup */
-  gtk_widget_show_all (combo_box->priv->popup_window);
+  gtk_widget_show (combo_box->priv->popup_window);
 
   gtk_widget_grab_focus (combo_box->priv->popup_window);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo_box->priv->button),